package com.itheima.mapper;

import com.itheima.bean.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentMapper {

    @Select("select * from student")
    List<Student> findAll();

    @Insert("insert into student values (#{id},#{name},#{age})")
    Integer insert(Student stu);

    @Delete("delete from student where id=#{id}")
    Integer delete(Integer id);

    @Update("update student set name=#{name},age=#{age} WHERE id=#{id}")
    Integer update(Student stu);
}
